import Vue from "vue";
import App from "./App.vue";
import store from "@/store";
import router from "@/router";
import TypeNav from "@/components/TypeNav";
import Swiper from "@/components/Swiper";
import Pagenation from "@/components/Pagenation";
import "@/mock";
import VueLazyload from "vue-lazyload";
import loading from "@/assets/images/loading.gif"

//按需引入elementUI中的某些组件
import {Button,Dialog,Message} from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
//引入之后作为插件使用
Vue.use(Button);
Vue.use(Dialog);
Vue.use(Message);
Vue.use(VueLazyload,{
  loading
})
Vue.prototype.$message=Message

Vue.config.productionTip = false;

//全局注册公共组件TypeNav
Vue.component("TypeNav", TypeNav);
//全局注册公共组件Swiper
Vue.component("Swiper", Swiper);
//全局注册公共组件Pagenation
Vue.component("Pagenation", Pagenation);

new Vue({
  render: (h) => h(App),
  router,
  store,
  //事件总线
  beforeCreate() {
    Vue.prototype.$bus = this;
  },
}).$mount("#app");
